<?php
class System_Template extends Zend_Db_Table{ 
	public function __construct($config = array()) {
        parent::__construct($config);
    }
    public static function using($layoutName,$templateName = "Default"){
        $layoutPath = "../application/templates/".$templateName."/temp1";
        
		if($layoutName != ''){
			self::setLayout($layoutName,$layoutPath);
		} else{
			self::setLayout('default',$layoutPath);
		}
	}
	private function setLayout($name,$layoutPath)
	{
		$option = array ('layout' => $name,
				   'layoutPath' => $layoutPath );
        $reqSR = 0;
        if (isset($_POST['jxSystemRequest'])){
            $reqSR = $_POST['jxSystemRequest'];
        }
        if((int)$reqSR == 0 ){
            Zend_Layout::startMvc ( $option );
        }
	}
}